BCGControlBar for .NET > Ribbon Architecture Overview |
First time the Ribbon Control was introduced in Microsoft Office 2007.
The Ribbon Control replaces the traditional menus and toolbars with a collection of tabbed groups. Each tabbed group contains a set of category items with various control and command buttons. Usage of the Ribbon Control has a lot of advantages. It utilizes the available space much more efficiently. If the size of parent form is too small, it will be hidden. If the user wants to get more available space for the document, he can display only tabs without category items. If a Panel has been stretched and has no place to display all available controls, it turns into a menu button, which can display sub-items on a popup menu.
The main control, which contains another control to create MS Office 2007 style, is a Ribbon Control.
On the Ribbon Control you can see the following elements:
1. Caption.
The application name and system buttons are displayed on custom caption. Also it is possible to place on the caption the Quick Access Toolbar..
2.Tabs.
Tabs are used to organize controls in the Ribbon around the core scenarios and tasks that users perform with the application. .
3. CategoryPanels.
Each tab is related to the specified category panel. Only one Category Panel can be displayed on the Ribbon at once. A reference to the active category can be retrieved from the property ActiveCategory of the Ribbon Control. Every Category Panel contains a set of Category Items to group controls within the CategoryPanel. The location and size of CategoryItems will be calculated automatically according to the panel size to provide the best fit and utilize the free panel space.
4. Category Items.
Category Items are used to group related controls on the Category Panel. It makes browsing through the Category Panel easy. Each Category Item contains a caption below. A Category Item may contain a Launch Button, which is located at the right bottom corner.
The Launch Button should be used to execute commands logically common to the whole Category Item.
5 CategoryItemGroup.
Category Item Groups are located within Category Items. They are used to layout buttons and controls within Category Items. Category Item Groups are logical entities and their bounds are visible in Visual Studio designer only. A Category Item Group may have either horizontal, or vertical alignment. Vertical alignment tells to adjust all Ribbon elements by column, horizontal alignment adjusts all elements by line. You need to set the Wrap property to true to split the lines in the basic layout.
6. MainRibbonButton and MainRibbonPanel
The Main Ribbon Button is located at the upper-left corner of the application. It has 3-D appearance and contains a logo image. Main Ribbon Buttons is used to display the application menu. The application menu is implemented by the MainRibbonPanel object. By click on the MainRibbonButton the user can get an access to the commands, which execute action to be applied to the entire document such as New, Save, Print, etc.
MainRibbonPanel contains the list of recently opened document. Buttons associated with the names of files allow to open them. Main Ribbon Panel also contains Option Buttons located at the bottom of panel. Usually, Option Buttons are used for access to the Option Dialog.
7. Ribbon controls.
The RibbonControl is able to display different types of controls. These controls include ToolbarButtons, ToolBarGalleryButtons, ToolbarButtonGroups, ToolbarCheckBoxButtons, ToolbarComboBoxButtons, ToolbarGalleryButtons. The most of ribbon elements should have two images - small and large. In some cases when a ribbon element should display an image (it happens if the element has been stretched to the size when it can display image only), but the image has not been specified the library uses a default internal image.
8. Quick Access Toolbar.
Controls on the QAT are always available to user. Their visibility does not depend on the currently active tab. The QAT can be customized by placing buttons from the RibbonControl using context menu or by using RibbonOptionsDialog. Quick Access Toolbar can be located on the caption of the RibbonControl or below the RibbonControl.
9. RibbonOptionsDialog.
The simplest way to customize Quick Access Toolbar is to call the RibbonOptionsDialog box. Here you can choose a group of commands and select buttons which should be added to the QAT.
10. RibbonStatusBar
Ribbons includes an advanced, MS Office 2007-style status bar which extends the functionality of the standard status bar. The Ribbon status bar may contain controls like TrackBar, ButtonGroup, hyperlink label, RibbonStatusBarPane and so on.
11. Galleries
Ribbon Galleries work in three modes: in-ribbon (compact mode), popup (full mode) and menu. Each gallery is built from gallery groups. Each group has a group name and two collections: collection of images and collection of strings. The collection of strings currently is used in the menu mode only (see in MSOffice2007Demo Change Styles | Style set and Change Styles | Colors) galleries.
Also, Ribbon combo box button is based on popup gallery implementation. You can design a combo box as a gallery, make the drop down part resizable and so on.
12. Context Categories
You can add to the Ribbon control a collection of context category groups. Each Context category group contains at least one Category Item. Context category group can be assigned its own color chosen from a predefined set of 7 colors. A Context category group and its related Category Items should be shown and hidden depending on the current application context.
13. Ribbon Options Dialog
Ribbon Options dialog by the default displays only the Customize page. However, you can design your own forms and add them to the Options dialog at runtime. The most important thing here is to place all controls on a Panel control. The library will take this control and move it to the library-provided Options dialog.